<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>JavaScript DOM修改元素CSS样式</title>
    </head>
    <body>
        <h3>JavaScript DOM修改元素CSS样式</h3>
        <hr />
        <p id="test">Hello 2016</p>
        <script>
		//获取id="test"的段落元素对象
		var p = document.getElementById("test");
		//修改该段落元素的样式
		p.style.backgroundColor = "orange";
		p.style.color = "white";
		p.style.fontWeight = "bold";
		p.style.textAlign = "center";
        </script>
    </body>
</html>